package com.venutech.gongan.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.venutech.gongan.dao.DictDataMapper;
import com.venutech.gongan.entity.DeviceDate;
import com.venutech.gongan.entity.DeviceStatus;
import com.venutech.gongan.entity.DictData;
import com.venutech.gongan.model.ResultFormat;
import com.venutech.gongan.service.DictDataService;
import com.venutech.gongan.util.ResultUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DictDataServiceImpl implements DictDataService {
    @Resource
    private DictDataMapper dictDataMapper;


    @Override
    public ResultFormat insert(DictData dictData) {
        Integer insert = dictDataMapper.insert(dictData);
        if (insert > 0) {
            return ResultUtil.success();
        }else {
            return ResultUtil.error(100,"添加失败");
        }
    }

    @Override
    public int deleteById(Integer dict_code_id) {
        return dictDataMapper.deleteById(dict_code_id);
    }

    @Override
    public DictData getById(Integer dict_code_id) {
        return dictDataMapper.getById(dict_code_id);
    }

    @Override
    public int updateDictData(DictData dictData) {
        return dictDataMapper.updateDictData(dictData);
    }

    @Override
    public List<DictData> getAllDictName(String dict_type) {
        return dictDataMapper.getAllDictName(dict_type);
    }

    @Override
    public List<DictData> getSelQybm() {
        return dictDataMapper.getSelQybm();
    }

    @Override
    public List<DictData> getSelXlbm() {
        return dictDataMapper.getSelXlbm();
    }

    @Override
    public List<DictData> getSellwsx() {
        return dictDataMapper.getSellwsx();
    }

    @Override
    public List<DictData> getSelsbzt() {
        return dictDataMapper.getSelsbzt();
    }

    @Override
    public List<DictData> getSelsbcs() {
        return dictDataMapper.getSelsbcs();
    }

    @Override
    public List<DictData> getSelzxbm() {
        return dictDataMapper.getSelzxbm();
    }

    @Override
    public List<DictData> getSelsxjlx() {
        return dictDataMapper.getSelsxjlx();
    }

    @Override
    public List<DictData> getSelsxjgnlx() {
        return dictDataMapper.getSelsxjgnlx();
    }

    @Override
    public List<DictData> getSelsxjwzlx() {
        return dictDataMapper.getSelsxjwzlx();
    }

    @Override
    public List<DictData> getSelsxjbgsx() {
        return dictDataMapper.getSelsxjbgsx();
    }

    @Override
    public List<DictData> getSeljsfw() {
        return dictDataMapper.getSeljsfw();
    }

    @Override
    public List<DictData> getSelzcfbl() {
        return dictDataMapper.getSelzcfbl();
    }

    @Override
    public List<DictData> getSelsxjbmgs() {
        return dictDataMapper.getSelsxjbmgs();
    }

    @Override
    public List<DictData> getSelgajg() {
        return dictDataMapper.getSelgajg();
    }

    @Override
    public List<DictData> getSelssbmhy() {
        return dictDataMapper.getSelssbmhy();
    }

    @Override
    public List<DictData> getSelsbsslx() {
        return dictDataMapper.getSelsbsslx();
    }

    @Override
    public List<DictData> getSelWorkType() {
        return dictDataMapper.getSelWorkType();
    }

    @Override
    public List<DictData> getSelWorkState() {
        return dictDataMapper.getSelWorkState();
    }

    @Override
    public List<DictData> getSelAllXh() {
        return dictDataMapper.getSelAllXh();
    }

    @Override
    public List<DictData> getSelAllyys() {
        return dictDataMapper.getSelAllyys();
    }

    @Override
    public List<DictData> getSelAllMjxzqy() {
        return dictDataMapper.getSelAllMjxzqy();
    }


    @Override
    public Page<DictData> getInfo(Integer pageNo, Integer pageSize, String begintime, String endtime, String badw, String dict_type) {
        Page<DictData> page = new Page<>(pageNo,pageSize);
        List<DictData> list = dictDataMapper.getInfo(begintime,endtime,badw,page,dict_type);
        return page.setRecords(list);
    }

    @Override
    public DictData getDictDataByDictValueAndDictType(String dictValue, String dictType) {
        return dictDataMapper.getByDictValueAndDictType(dictValue, dictType);
    }

    /**
     * @author:   
     * date: 2021/11/26 0026 16:14
     * @since: JDK 1.8
     * @description: 这里用一句话描述这个方法的作用 
     * @param: 
     * @return: 
     */
    @Override
    public List<DeviceDate> getDeviceList() {
        return dictDataMapper.getDeviceList();
    }

    @Override
    public List<DeviceStatus> getDeviceStatusList() {
        return dictDataMapper.getDeviceStatusList();
    }

}
